package com.gof.example.command;

import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Created by zhiyuan on 2018/5/10 10:15.
 * haiming.fei@tongdun.cn
 */
public class Menu {

    private List<MenuItem> menuItems = new ArrayList<>();

    public void addMenuItem(MenuItem c) {
        menuItems.add(c);
    }

    public void deleteMenuItem(MenuItem c) {
        menuItems.remove(c);
    }

    public void displayFunctions() {
        System.out.println("display menuItems function: ");
        for (MenuItem item : menuItems) {
            item.click();
        }
    }
}
